﻿// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import VueRouter from 'vue-router';
import App from './banner_view.vue';
import router from '../../banner_view/banner_view_router.js';
import Vuex from 'vuex';
import store from '../../vuex/store_index';
import axios from 'axios';
import {mapState, mapMutations,mapActions,mapGetters} from 'vuex';
Vue.use(Vuex);
Vue.use(VueRouter);
Vue.prototype.$http = axios;
Vue.config.productionTip = false;// 来关闭生产模式下给出的提示
axios.defaults.headers.common['Content-Type'] = 'application/json;charset=UTF-8';

//router.beforeEach((to, from, next) => {
//  if(store.getters.Loading_show == false){
//    store.commit('Change_loading_show')
//  }
//  if (to.meta.requireAuth) {
//    if (sessionStorage.getItem("user_login") == "true") {
//       next()
//    }
//    else {
//      next({
//        path: '/'
//      })
//    }
//  }else{
//    if (sessionStorage.getItem("user_login") == "true") {
//      next({
//        path: '/index'
//      })
//    }else{
//      next();
//    }
//   }
//})


/* eslint-disable no-new */
new Vue({
    el: '#app',
    router,
    store,
    template: '<App/>',
    components: { App }
})
